using System.ComponentModel.DataAnnotations;

namespace Model.Dto.Teacher;

/// <summary>
/// 教师登录传输对象
/// </summary>
/// <remarks>
/// 用于教师登录时接收客户端提交的数据，包含数据验证规则
/// </remarks>
public class TeacherLogin
{
    /// <summary>
    /// 手机号
    /// </summary>
    [Required(ErrorMessage = "手机号不能为空")]
    [RegularExpression(@"^1[3-9]\d{9}$", ErrorMessage = "手机号格式不正确")]
    public string Mobile { get; set; } = string.Empty;
    
    /// <summary>
    /// 密码
    /// </summary>
    [Required(ErrorMessage = "密码不能为空")]
    [StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度必须在6-100个字符之间")]
    public string Password { get; set; } = string.Empty;
}